package com.mybatis.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;

@Component("book")
public class Book implements Serializable {
    private Integer book_id;
    private String book_name;
    private BigDecimal book_price;
    private Publisher pub;
    private Date date;
    private Timestamp publish_time;


    public Book() {
        super();
    }

    public Book(String book_name,BigDecimal book_price){
        this.book_name=book_name;
        this.book_price=book_price;
    }

    public Book(int book_id) {
        this.book_id=book_id;
    }

    @Override
    public String toString() {
            return "Book{" +
                "book_id=" + book_id +
                ", book_name='" + book_name + '\'' +
                ", book_price=" + book_price +
                ", date=" + date +
                ", publish_time=" + publish_time +
                '}'+'\n';
    }


    public Book(String book_name, BigDecimal book_price, Publisher publisher, Date date, Timestamp publish_time) {
        this.book_name = book_name;
        this.book_price = book_price;
        this.pub = publisher;
        this.date = date;
        this.publish_time = publish_time;
    }

    public Publisher getPublisher() {
        return pub;
    }

    public void setPublisher(Publisher publisher) {
        this.pub = publisher;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Integer getBook_id() {
        return book_id;
    }

    public void setBook_id(Integer book_id) {
        this.book_id = book_id;
    }

    public String getBook_name() {
        return book_name;
    }

    public void setBook_name(String book_name) {
        this.book_name = book_name;
    }

    public BigDecimal getBook_price() {
        return book_price;
    }

    public void setBook_price(BigDecimal book_price) {
        this.book_price = book_price;
    }

    public Timestamp getPublish_time() {
        return publish_time;
    }

    public void setPublish_time(Timestamp publish_time) {
        this.publish_time = publish_time;
    }
}
